package Client;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import Billing.Billing;

public class Client 
{
	private String name;
	private String operator_name;
	private BillingGenerator generator;
	private OperatorSelector selector;
	
	public Client(String name, String billing_filename, Double changes_ratio, Integer memory_long, String[] operator_names)
	{
		this.name = name;
		selector = new OperatorSelector(changes_ratio, memory_long, operator_names);
		
		generator = new BillingGenerator(billing_filename);
		operator_name = "";
	}
	
	public Client(String name, Double changes_ratio, Integer memory_long, String[] operator_names)
	{
		this.name = name;
		selector = new OperatorSelector(changes_ratio, memory_long, operator_names);
		operator_name = "";
	}
	
	public String getOperatorName()
	{
		return operator_name;
	}
	
	public void setOperatorName(String name)
	{
		operator_name = name;
	}

	public String getName()
	{
		return name;
	}
	
	public Billing getBilling(String[] clients_operators)
	{
		return generator.produceBiling(clients_operators);
	}
	
	public String selectOperator(Map<String, Double> costs)
	{
		this.operator_name = selector.selectOperator(costs, operator_name);
		return operator_name;
	}
}